package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReturnTheSizeOfTheIterableOr0IfItsNull {
	public static int size(Iterable<?> iterable) {
		if (iterable == null) {
			return 0;
		}
		int count = 0;
		for (@SuppressWarnings("unused")
				Object o : iterable) {
			count++;
		}
		return count;
	}
}
